﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace WuDada.Core.Post.Domain
{
    [Serializable]
    [DataContract]
    public class AttachedFileVO : BaseObject
    {
        #region Constructor
        public AttachedFileVO()
        {
            Flag = 1;
            SortNo = 0;
            FileType = Type.None;
        }
        #endregion

        #region Property

        /// <summary>
        /// Pkey
        /// </summary>
        [DataMember]
        public virtual int AttachedFileId { get; set; }

        /// <summary>
        /// 屬於的Post
        /// </summary>
        [DataMember]
        public virtual PostVO Post { get; set; }

        /// <summary>
        /// 檔名
        /// </summary>
        [DataMember]
        public virtual string FileName { get; set; }

        /// <summary>
        /// Youtube內容
        /// </summary>
        [DataMember]
        public virtual string YoutubeContent { get; set; }

        /// <summary>
        /// 類別
        /// </summary>
        [DataMember]
        public virtual AttachedFileVO.Type FileType { get; set; }

        /// <summary>
        /// 檔案標題
        /// </summary>
        [DataMember]
        public virtual string Title { get; set; }

        /// <summary>
        /// 檔案敘述內容
        /// </summary>
        [DataMember]
        public virtual string Content { get; set; }

        /// <summary>
        /// 上架日
        /// </summary>
        [DataMember]
        public virtual DateTime? ShowDate { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [DataMember]
        public virtual int SortNo { get; set; }

        /// <summary>
        /// 檔案類別
        /// </summary>
        public enum Type
        {
            None = 0,
            Pic = 1,
            Video = 2
        }

        [DataMember]
        public virtual int Flag { get; set; }

        /// <summary>
        /// 取文字_上下架
        /// </summary>
        [DataMember]
        public virtual string GetStr_Flag
        {
            get
            {
                string result = "";

                if (Flag == 0)
                {
                    result = "否";
                }
                else if (Flag == 1)
                {
                    result = "是";
                }

                return result;
            }
        }

        #endregion
    }
}
